[ Top | Up |
Prev | Next |
Map | Index ]
Syntax of configuration commands
This section describes how analog finds configuration commands, and what the
syntax of a configuration file should be. The syntax of individual commands is
given in the Quick reference section
later.
When analog starts up, it first reads options from configuration files
and the command line (assuming that you are running analog from an operating
system with a command line). Defaults for many of these options will have
already been set in the file analhead.h at the time the program
was compiled. So if you compile your own version of analog, rather than
downloading a pre-compiled executable, you can also set some options in
that file before compiling. Those options are all documented there.
The first file which analog reads is the default
configuration file,
normally called analog.cfg. You can stop this file being read by
specifying the option -G on the command line. Then the command line
arguments are read, in the order in which they appear. Finally, the
mandatory configuration file is read, if you specified one when you
compiled the program. This is a configuration file which cannot be overridden
by the user: if it is not found, analog exits immediately. This allows a
system administrator to prevent users analysing certain files or producing
certain reports, for example. However, note that the
only certain way to prevent users analysing things is to deny them access to
the logfile. Otherwise there is nothing to stop them analysing the logfile
using another copy of analog or another program.
You can include another configuration file from the
command line by using a
command like +gother.cfg. (Note that there is no space between
+g and the filename; this is true of all command line arguments.)
You can also include another configuration file from within a configuration
file by a command like
CONFIGFILE other.cfg
The commands in the other configuration file are read immediately, in order.
The program then continues reading the command line or calling configuration
file where it left off. Note that reading an alternative configuration file
does not stop the default configuration file being read as well. To do
that you have to specify -G as well as the +g command.
In the Mac version, you can start up a program with a particular configuration
file instead of the default one by dragging the configuration file onto the
analog icon. The file must start with a #.
You can also specify any configuration command on the
command line even if it
doesn't have a command line abbreviation, by use of the +C command.
For example, +C"UNCOMPRESS *.gz gzcat" will include that command.
Here are the syntax rules for configuration
commands. A configuration file
contains several commands on separate lines; any text after a hash
(#) on a line is ignored as a comment. Each command consists of
the command name followed by one or two arguments. An argument to a command may
optionally be placed in single or double quotes or parentheses, and it must be
if the argument contains a hash or a space. So, for example, here are some
valid configuration commands.
DAILY OFF # We don't want a daily summary
FULLDAILY "ON" # We want a full daily report instead
HOSTNAME (Spam Widgets Inc.) # Spaces, so quotes or brackets needed
Generally later commands override earlier ones if you can have only one of
that thing (e.g., for the OUTFILE), or supplement them
if you can have several (e.g., for the LOGFILE, because you can
read several logfiles).
If all the options seem a bit confusing, just run
analog -settings [other options]
or include PRINTVARS ON in the configuration commands.
That will tell you what the values of all the variables will be, based on
the defaults in analhead.h, the configuration commands, and the
command line options. If you're on Unix or Windows, remember that you can send
the output to a file with
analog -settings > file
Stephen Turner
Personal e-mail: analog-author@lists.isite.net
Need help with analog? Subscribe to the analog-help
mailing list
[ Top | Up |
Prev | Next |
Map | Index ]